<?php 
  include("common/conn.php");
  if(!isset($_SESSION['userid'])){
    // echo "<script>window.location.href='login.php';</script>";
  }

   if($_REQUEST[act]=='ok'){
      if($_REQUEST[id]){
        mysql_query("update  quyu_kuai  set district='$_REQUEST[district]',kuaidiyuan='$_REQUEST[kuaidiyuan]',phone='$_REQUEST[phone]',address='$_REQUEST[address]'   where  id='$_REQUEST[id]'");
     }else{
        mysql_query("insert  into quyu_kuai(pid,district,kuaidiyuan,phone,address)  VALUES  ('$_REQUEST[pid]','$_REQUEST[district]','$_REQUEST[kuaidiyuan]','$_REQUEST[phone]','$_REQUEST[address]')");
     }

   }

?>

<!DOCTYPE html>  
<html>
    <head>  
        <meta charset="UTF-8">
        <title>后台管理</title> 
        <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" /> 
        <meta charset="uft-8">
        <!-- 权限控制 -->
        <link type="text/css"  rel="stylesheet"  href="css/zTreeStyle/zTreeStyle.css"/>
        <link rel="stylesheet" href="css/css.css" type="text/css">
        <script src="js/jquery-2.1.0.js"></script>
        <script type="text/javascript" src="js/jquery.ztree.all-3.5.min.js"></script>
        <!-- 对话框插件 -->
        <script src="js/artDialog/jquery.artDialog.js?skin=twitter"></script>
        <script src="js/artDialog/plugins/iframeTools.js"></script>
         <!-- 表单库插件 -->
        <script type="text/javascript" src="js/jquery.form.min.js"></script>
        <!-- 配置artDialog全局默认参数 -->
        <script type="text/javascript">
        (function (config) {
            config['lock'] = true;
            config['fixed'] = true;
            config['top'] = '50%';
        })(art.dialog.defaults);
        </script>
      <script type="text/javascript">
      function toSubmit(){
              $("#answerform").ajaxSubmit({
                  url:'updatequyuKuaidi.php?act=ok',
                  type:"POST",
                  success:function(data){
                      $.dialog.close();
                  }           
              }); 
          }
      </script>
</head>
<body  class="dialogBody">
         <?php
              if($_REQUEST[id]){
                $result = mysql_query("select * from `quyu_kuai` where   id='$_REQUEST[id]'");
                 $ret = mysql_fetch_array($result);
              }
          ?>
            <!-- 增加节点 -->
            <div  style="margin: 20px 20px">
                  <form  id="answerform">
                       <input type="hidden" name="id"  value="<?php echo $ret[id]?>">
                       <input type="hidden" name="pid"  value="<?php echo $_REQUEST[pid]?>">
                       <label><font style="color:red;">*</font>地区名称(如:贵州省\贵阳市\白云区\新世界)：</label>
                       <input type="text" name="district"  value="<?php echo $ret[district]?>">
                       <br/><br/>
                       <label>快递员：</label>
                       <input type="text" name="kuaidiyuan"  value="<?php echo $ret[kuaidiyuan]?>">
                       <br/><br/>
                       <label>电话：</label>
                       <input type="text" name="phone"  value="<?php echo $ret[phone]?>">
                       <br/><br/>
                       <label>地址：</label>
                       <input type="text" name="address"   style="width:300px;"  value="<?php echo $ret[address]?>">
                       <br/><br/>
                       <div style="text-align:center;">
                         <input type="button" class="button"  value="提交" onclick="toSubmit();">
                         <input type="reset" class="button" value="重置">
                       </div>
                   </form>
             </div>
</body>
</html>

       